package com.emep.changzhi.analyse.entity.basics;


import com.emep.changzhi.analyse.entity.systeminfo.SysUserInfo;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * @author xy
 * @Description: 行政区划表
 * @date 2018/2/24 13:33
 * @version V1.0
 */
@Data
@Entity
@Table(name = "sys_area_info")
public class SysAreaInfo implements Serializable {
    private static final long serialVersionUID = 4729172616377043190L;











    @Id
    @GenericGenerator(name = "system-uuid", strategy = "uuid")
    @GeneratedValue(generator = "system-uuid")
    private String  id;

    @Column(name = "name",columnDefinition="varchar(100) COMMENT '行政区划名字'" )
    private String name;

    @Column(name = "name_pinyin",columnDefinition="varchar(100) COMMENT '拼音'" )
    private String namePinyin;

    @Column(name = "code",columnDefinition="varchar(100) COMMENT '区域code'" )
    private String code;

    @Column(name = "national_code",columnDefinition="varchar(100) COMMENT '国家区域编码'" )
    private String nationalCode;

    @Column(name = "latitude",columnDefinition="varchar(100) COMMENT '政府纬度'" )
    private String latitude;

    @Column(name = "longitude",columnDefinition="varchar(100) COMMENT '政府经度'" )
    private String longitude;

    @Column(name = "parent_id",columnDefinition="varchar(100) COMMENT '父id'" )
    private String parentId;
    @Column(name = "parent_path",columnDefinition="varchar(100) COMMENT '逗号分隔,并且逗号结束，如：01,002'" )
    private String parentPath;

    @Column(name = "zf_latitude",columnDefinition="varchar(100) COMMENT '逗号分隔,并且逗号结束，如：01,002'" )
    private String zfLatitude;

    @Column(name = "zf_longitude",columnDefinition="varchar(100) COMMENT '逗号分隔,并且逗号结束，如：01,002'" )
    private String zfLongitude;

    @Column(name = "area_code",columnDefinition="varchar(100) COMMENT '系统层级码'" )
    private String areaCode;

    @Column(name = "area_name",columnDefinition="varchar(100) COMMENT '行政区划名字'" )
    private String areaName;
    @Column(name = "is_delete",columnDefinition="varchar(100) COMMENT '删除状态'" )
    private  String isDelete = "0";
    @Column(name = "create_date",columnDefinition="varchar(100) COMMENT '信息录入时间'" )
    @OrderBy("create_date DESC")
    private String createDate = String.valueOf(System.currentTimeMillis());


    /**
     * 用户id
     */
    @OneToMany(cascade = CascadeType.ALL)
    private List<SysUserInfo> sysUserInfos;
}
